package com.tiger.cloud.controller.crm;

import com.tiger.cloud.filter.IgnoreAuth;
import com.tiger.cloud.model.ext.ActiveCountPojo;
import com.tiger.cloud.service.crm.ActiveCountService;
import com.tiger.cloud.util.Response;
import com.tiger.cloud.util.ResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping(value = "userActiveCount")
@Api(value = "统计用户活跃数", tags = "统计用户活跃数")
public class ActiveCountController {
    @Autowired
    private ActiveCountService activeCountService;

    @RequestMapping(value = "insertActiveCount", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "新增用户活跃数", notes = "新增用户活跃数")
    @CrossOrigin
    @IgnoreAuth
    public Response findNewVersion(@RequestBody ActiveCountPojo activeCountPojo) {
       boolean flat = activeCountService.insertActiveCount(activeCountPojo);
       if(flat){
           return ResponseUtil.ok();
       }else{
           return ResponseUtil.error("统计用户活跃数失败!");
       }
    }

}
